package com.letoken.platform.repo.mall.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.letoken.platform.repo.app.po.AppUserIssue;
import com.letoken.platform.repo.app.req.user.UserLevelReq;
import com.letoken.platform.repo.mall.po.AppMallIssue;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>
 * 用户商城消费发行信息 Mapper 接口
 * </p>
 *
 * @author 作者
 * @since 2023-04-20
 */
public interface AppMallIssueMapper extends BaseMapper<AppMallIssue> {

    int updateMallIssueByUseIid(@Param("issueAmount") BigDecimal issueAmount, @Param("circulationAmount")BigDecimal circulationAmount, @Param("circulationRemain")BigDecimal circulationRemain, @Param("userId")Integer userId, @Param("version")Integer version, @Param("countDown")Integer countDown, @Param("rewardTime")Integer rewardTime);

    List<AppMallIssue> getWaitRewardList();

    List<UserLevelReq> selectUserLevel(@Param("userId")Integer userId);

    BigDecimal getMaxLevelRate();

    @Select("select * from app_mall_issue where circulation_remain>0")
    List<AppMallIssue> getIssueUserIdList();

}
